Factors out the common behaviors of all pieces 提取了所有對象的共有行為:
Factor out long expressions in the middle of statements 如果長表達式在語句的中間,可以額外提出來。
Factoring out common code is a good practice , but it can t be applied in all cases 分解出公共代碼是一個很好的習慣,但它并不適用于所有的情況。
Cures and preventions : factor out the common code , if possible ; otherwise , update it 治療和預防措施:如果可能,分解出公共代碼;否則就對其進行更新。
Just as before , we can minimize bugs of this sort by factoring out the common code 就象以前一樣,我們可以通過分解出公共代碼來將這種錯誤控制到最少。
Of course , this example is one that a beginning programmer would quickly learn to avoid by factoring out the common code 當然,這個示例所示的錯誤是編程新手可以很快學會通過分解出公共代碼來避免的。
To improve performance , you may wish to factor out the code for each model attribute into its own method or a single method with a " switch " 要改進性能,您可能希望將每個模型屬性的代碼分解成其自己的方法(或者是一個帶有“開關( switch ) ”的方法) 。
Relationships indicate that you want to look closely at similar use cases , trying to find commonality that can be factored out into " subset " cases or equivalents 關系表示您應該密切關注相似的用例,嘗試查找共同點,它們可以被分解成“子集”用例或等價物。
However , some negative factors out of network issue a grim challenge to the psychological health of college students who are destitute of self - restraint and resistance against temptation 同時又給自制力、抵御力不強的大學生心理健康提出了嚴峻的挑戰(zhàn)、產(chǎn)生了一些負面影響。
When each cast is held to this level of scrutiny , you may find yourself factoring out many of these casts by adding methods to the relevant subclasses 當對每個類型強制轉(zhuǎn)換進行這種級別的詳細審查時,您可能會發(fā)現(xiàn)通過向相關的子類添加方法,您將許多這些類型強制轉(zhuǎn)換分解了。